
<%@page contentType="text/html;charset=UTF-8" language="java" import="com.compuvest.web.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<%@ taglib uri="/WEB-INF/tld/head.tld" prefix="head" %>
<%@ taglib uri="/WEB-INF/tld/bottom.tld" prefix="bottom" %>

<jsp:useBean id="sb" class="MySQL" scope="application"/>
<jsp:useBean id="advertArray" class="AdvertArray" scope="application"/>
<jsp:useBean id="basket" class="Basket" scope="session"/>
<%
//    Customer cust = basket.getCustomer();
//    if(cust == null) {
//	response.sendRedirect(application.getInitParameter("https") + "CustomerForm.jsp");
//	return;
  //  }

    Customer cust = new Customer();
    String vpassword = advertArray.getString(request.getParameter("vPassword"), cust.getPassword());
    String mode = request.getParameter("mode");
    if(mode != null && "Send Form".equals(mode)) {

        cust.setType("C");
	cust.billing.setCompany(request.getParameter("billingCompany"));
	cust.setResellerCode(request.getParameter("resellerCode"));
	cust.billing.setFirstName(request.getParameter("billingFirstName"));
	cust.billing.setLastName(request.getParameter("billingLastName"));
	cust.billing.setAddress1(request.getParameter("billingAddress1"));
	cust.billing.setAddress2(request.getParameter("billingAddress2"));
	cust.billing.setCity(request.getParameter("billingCity"));
	cust.billing.setCountry(request.getParameter("billingCountry"));
	cust.billing.setState(request.getParameter("billingState"));
	cust.billing.setZip(request.getParameter("billingZip"));
	cust.billing.setZip4(request.getParameter("billingZip4"));
	cust.billing.setPhone(request.getParameter("billingPhone"));
	cust.billing.setCell(request.getParameter("billingCell"));
	cust.billing.setFax(request.getParameter("billingFax"));
        cust.setEmail(request.getParameter("Email"));
	cust.setPassword(request.getParameter("Password"));
	cust.setNotice(request.getParameter("notice"));
	cust.setHearAboutUs(request.getParameter("hear"));

	// update database
	basket.setCustomer(cust);

        response.sendRedirect(application.getInitParameter("https") + "ResellerSendForm.jsp");
	return;
    }
%>
<html>
<%@include file="/incl/head.html" %>

<body>

<table style='height:100%;'>
 
<tr valign=top height=84>
 <td colspan=3>

<head:show />

 </td>
</tr>

<tr valign=top align=center>
 <td>

<br/>
<div style='font:bold 16pt Arial;color:#002e5b;'>Reseller Account</div>
<br/>
<div style='width:85%;background:white;'>
<fieldset>
 <dl style='padding:15px 15px;text-align:justify;font:normal 10pt arial;'>
 &nbsp;&nbsp;&nbsp;&nbsp;CompuVest Corp. invites resellers to do business with us. All discounts are based on
 quantity of purchased goods and a payment method used.<br/>
 &nbsp;&nbsp;&nbsp;&nbsp;Due to commodity nature of our business, we cannot offer a fixed discount on the products we sell.
 Please call or e-mail us with your purchase request, and we will provide you with the best possible price at a given time.<br/><br/>

<dt><b>Reseller Benefits:</b>
 <dd>Blind Drop shipments directly to your customer
 <dd>Dedicated CompuVest sales representative for all questions and concerns
 <dd>Net Terms - additional rules apply, ask your agent how to qualify

<dt><b>Rules for Resellers:</b>
 <dd>We require a business license or a Reseller Certificate with full contact information to be faxed to us in order
 to set up a reseller account.

<dt><b>International Resellers:</b>
 <dd><i>Payment methods:</i>
 <dd>All Countries - Western Union, Wire Transfer or American Express (Visa and Master card are not accepted).
 <dd>Canada - Western Union, Wire Transfer, American Express, Visa or Master card.
 <dd>Please visit our
 <a href="<%= application.getInitParameter("info") + "Payment.jsp" %>">payments section</a>
 for more information on how to make the payment correctly.<br/><br/>
 Please FAX a copy of your State issued Resale License to (425) 251-5000
 </dl>
</fieldset>
</div>
<br/>

<form action='<%= application.getInitParameter("https") + "Reseller.jsp" %>' onSubmit='return isDoneR(this);' method='POST' enctype="application/x-www-form-urlencoded">
<div style='width:40%;'>
<fieldset>
<legend style='font:bold 16pt arial;color:#002e5b;'> Reseller Form </legend>
<br/>
<table id='cvfrm'>
 <colgroup><col width='30%'><col width='70%'></colgroup>
 <tr><th>Company Name :</th>
  <td><input type=text name='billingCompany' size=30 maxlength=50 value='<%= cust.billing.getCompany() %>' onChange='this.value=toAlphaNumeric(this.value);'/></td>
 </tr>
 <tr><th>Reseller Certificate #</th>
  <td><input type=text name='resellerCode' size=30 maxlength=15 value='<%= cust.getResellerCode() %>' onChange='this.value=toAlphaNumeric(this.value);'/></td>
 </tr>
 <tr><th>First Name :</th>
  <td><input type=text name='billingFirstName' size=30 maxlength=50 value='<%= cust.billing.getFirstName() %>' onChange='this.value=toAlphaNumeric(this.value);'/></td>
 </tr>
 <tr><th>Last Name :</th>
  <td><input type=text name='billingLastName' size=30 maxlength=50 value='<%= cust.billing.getLastName() %>' onChange='this.value=toAlphaNumeric(this.value);'/></td>
 </tr>
 <tr><th>Address1 :</th>
  <td><input type=text name='billingAddress1' size=30 maxlength=50 value='<%= cust.billing.getAddress1() %>' onChange='this.value=toAlphaNumeric(this.value);'/></td>
 </tr>
 <tr><th>Address2 :</th>
  <td><input type=text name='billingAddress2' size=30 maxlength=50 value='<%= cust.billing.getAddress2() %>' onChange='this.value=toAlphaNumeric(this.value);'/></td>
 </tr>
 <tr>
  <th>Country :</th>
  <td>
   <select name='billingCountry'>
    <option value=''/>
    <%= advertArray.getCountryList(cust.billing.getCountry()) %>
   </select>
  </td>
 </tr>
 <tr><th>City/Locality :</th>
  <td><input type=text name='billingCity' size=30 maxlength=30 value='<%= cust.billing.getCity() %>' onChange='this.value=toAlphaNumeric(this.value);'/></td>
 </tr>
 <tr><th>State :</th>
  <td>
   <select name='billingState'>
    <option value=''/>
    <%= advertArray.getStateList(cust.billing.getState()) %>
   </select>
  </td>
 </tr>
 <tr><th>Postal/Zip Code :</th>
  <td>
   <input type=text name='billingZip' size=10 maxlength=10 value='<%= cust.billing.getZip() %>' onChange='this.value=toAlphaNumeric(this.value);'/> <b>-</b>
   <input type=text name='billingZip4' size=4 maxlength=4 value='<%= cust.billing.getZip4() %>' onChange='this.value=toAlphaNumeric(this.value);'/>
  </td>
 </tr>
 <tr><th>Phone :</th>
  <td><input type=text name='billingPhone' size=30 maxlength=20 value='<%= cust.billing.getPhone() %>' onChange='this.value=toAlphaNumeric(this.value);'/></td>
 </tr>
 <tr><th>Cell :</th>
  <td><input type=text name='billingCell' size=30 maxlength=20 value='<%= cust.billing.getCell() %>' onChange='this.value=toAlphaNumeric(this.value);'/></td>
 </tr>
 <tr><th>Fax :</th>
  <td><input type=text name='billingFax' size=30 maxlength=20 value='<%= cust.billing.getFax() %>' onChange='this.value=toAlphaNumeric(this.value);'/></td>
 </tr>
 <tr>
  <th>Email :</th>
  <td class=messg><input type=text name='Email' size=30 maxlength=128 type=text value='<%= cust.getEmail() %>' onChange='this.value=toAlphaNumeric(this.value);'/></td>
 </tr>
 <tr><th>Password :</th>
  <td><input type=password name='Password' size=30 maxlength=15 value='<%= cust.getPassword() %>' onChange='this.value=toAlphaNumeric(this.value);'/></td>
 </tr>
 <tr><th>Confirm Password :</th>
  <td><input type=password name='vPassword' size=30 maxlength=15 value='<%= vpassword %>'/></td>
 </tr>
 <tr><th colspan=2 style='text-align:left;padding:0 0 0 18px;'>Comments :</th></tr>
 <tr><td colspan=2 align=center><textarea cols=58 rows=5 name='notice'><%= cust.getNotice() %></textarea></td></tr>
 <tr><th colspan=2 style='text-align:left;padding:0 0 0 18px;'>Where did you hear about us?</th></tr>
 <tr><td colspan=2 align=center><input type=text name='hear' size=75 maxlength=128 value='<%= cust.getHearAboutUs()%>'/></td></tr>
</table>
</fieldset>
</div>
<br/>
<input type='submit' name='mode' value='Send Form'/>
</form>
<br/>

 </td>
</tr>

<tr height=35>
 <td colspan=3>

<bottom:show />

 </td>
</tr>

</table>


</body>
<%@ include file="./incl/tracking.incl" %>
</html>
